<!DOCTYPE HTML>
<html lang="en-US">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>

<input type='button' name='mybtn' id='mybtn'/>

<script type='text/javascript'>
    function myFunc() {
        alert(arguments.callee.caller.toString());
        var ev = window.event || arguments.callee.caller.arguments[0] , et = ev.srcElement || ev.target;
    }
    function myFunc2(e) {
        alert(e);
        alert(arguments[0]);
    }
    function a() {
        b();
    }
    function b() {
        alert(b === arguments.callee);
        alert(b.caller === a);
        alert(arguments.callee.caller === a);
    }
    function addEventHandler(oTarget, sEventType, fnHandler) {
        if (oTarget.addEventListener) {
            oTarget.addEventListener(sEventType, fnHandler, false);
        } else if (oTarget.attachEvent) {
            oTarget.attachEvent("on" + sEventType, fnHandler);
        } else {
            oTarget["on" + sEventType] = fnHandler;
        }
    }
    var BindAsEventListener_t = function (object, fun) {
        var args = Array.prototype.slice.call(arguments).slice(2);
        return function () {
            return fun.apply(object, [arguments[0] || window.event].concat(args));
        }
    };
    addEventHandler(document.getElementById("mybtn"), "click", myFunc);  //1
    //addEventHandler( document.getElementById("mybtn") , "click" , myFunc2);  //2
    //myFunc2();
    /**
     * @url: http://xuganggogo.iteye.com/blog/614872
     * qw里的getEvent如下：
     getEvent: function(event, element) {
        if (event) {
            return event;
        } else if (element) {
            if (element.document) {return element.document.parentWindow.event; }
            if (element.parentWindow) {return element.parentWindow.event; }
        }

        //这里就是这种情况的处理，但个人感觉没有必要。
        if (window.event) {
            return window.event;
        } else {
            var f = arguments.callee;
            do {
                if (/Event/.test(f.arguments[0])) {return f.arguments[0]; }
            } while (f = f.caller);
        }
    },
     */

</script>
</body>
</html>